 <script>

 $(function() {ldelim}
  $( "#tabs" ).tabs();
                //$("#tabs").tabs('load',current_index);
 {rdelim});


             $(function(){ldelim}

             $('#producttable').dataTable({ldelim}
                "bJQueryUI": true,
                "sPaginationType": "full_numbers",
                  "bStateSave": true,
                  "iCookieDuration":120,
                  "aaSorting": [[ 0, "desc" ]]

   {rdelim} );
{rdelim} );
</script>
<table>
        <tr>
            <td> <img src="images/icons/add.png"><a onclick="loadPage('product/addproduct/101000100001');" href="javascript: void(0)">Add New</a></td>
            <td> <img src="images/icons/search.gif"><a onclick="updatesearchstr()" href="javascript: void(0)">Update Search string</a></td>
           <td>&nbsp;&nbsp;&nbsp;</td>
           <td>Category</td>
		
               	<td><select name="category" id="category" onchange="loadPage('product/index/cat-'+this.value);">
		<option value="">Select Category</option>
		{section name=sec2 loop=$cat_arr}
		
		<option value="{$cat_arr[sec2].cat_id}" {$select}>{$cat_arr[sec2].cat_desc}</option>
		{/section}
		</select>
		</td>   
                
	        <td>&nbsp;&nbsp;&nbsp;</td>
		<td>Sub Category</td>
		<td>
			<div id="subcat_loader">
				<select name="subcat" id="subcat" onchange="loadPage('product/index/subcat-'+this.value)">
				<option value="">Sub Category</option>
                                {section name=sec3 loop=$subcat_arr}
                                
                                <option value="{$subcat_arr[sec3].cat_id}" {$select}>{$subcat_arr[sec3].cat_desc}</option>
                                {/section}
				</select>
                        			</div></td>
                        <td>&nbsp;&nbsp;&nbsp;</td>
                        <td><input   value="{$searchkey}"   type="text" id="searchkey" name="searchkey">
                            <input type="button" onclick="filterbykey()" value="Go">
                        </td>
                        
             <td>&nbsp;</td>
             <td><a href="javascript: void(0);" onclick="loadPage('product/homepageproduct/')">Home Page Products</a></td>

	</tr>
        <tr><td>&nbsp;</td></tr>
        </table>

</div>
                        
                        
                        
</tr>
<div align="center">
	<table border="0" width="100%" cellpadding="0" cellspacing="0" class="display" id="producttable">
            <thead>
		<tr>
			<th width="5%" align="center" class="table-header-repeat">Code</th>
                        <th width="5%" align="center" class="table-header-repeat">Item Code</th>
			<th width="20%" align="center" class="table-header-repeat line-left">Product Title</th>
			<th width="5%" class="table-header-repeat line-left">Price</th>
			
			<th width="9%" class="table-header-repeat line-left">Category</th>
			<th width="9%" class="table-header-repeat line-left">Sub Category</th>
			<th width="3%" class="table-header-repeat line-left">Clicks</th>
			<th width="3%" class="table-header-repeat line-left">Status</th>
			<th width="2%" class="table-header-repeat line-left">&nbsp;</th>
			<th width="2%" class="table-header-repeat line-left">&nbsp;</th>
                        <th width="2%" class="table-header-repeat line-left">&nbsp;</th>
                        <th width="2%" class="table-header-repeat line-left">&nbsp;</th>
		</tr>
                </thead>
                <tbody>
		{section name=sec1 loop=$item_arr}
		<tr>
			<td>{$item_arr[sec1].id}</td>
                        <td>{$item_arr[sec1].add_id}</td>
			<td>{$item_arr[sec1].title}</td>
			<td>{$item_arr[sec1].addamount}</td>
			
			<td>{$item_arr[sec1].catid}</td>
			<td>{$item_arr[sec1].subcatid}</td>
			<td>{$item_arr[sec1].user_clicks}</td>
			<td>{$item_arr[sec1].status}</td>
                       
                       
			<td><a href="javascript: void(0);" onclick="loadPage('product/editproduct/{$item_arr[sec1].add_id}');"><img src="images/icons/edit.gif" width="15" height="15" /></a></td>
			<td><a href="javascript: void(0);" onclick="loadPage('product/addimage/{$item_arr[sec1].add_id}');"><img src="images/icons/imgpreview.png" width="20" height="20" /></a></td>
                        <td><a href="javascript: void(0);" onclick="loadPage('product/addfeatures/{$item_arr[sec1].add_id}');"><img src="images/icons/settings.gif" width="20" height="20" /></a></td>
		        <td><a href="javascript: void(0);" onclick="deleteproduct({$item_arr[sec1].add_id});"><img src="images/icons/a-minus.gif" /></a></td>
                </tr>
		{/section}
            </tbody>
	</table>
	 
</div>
<script type="text/javascript">
    function filterbykey()
    {ldelim}
        var searckkey= $("#searchkey").val();
        var catid= $("#category").val();
        var subcat= $("#subcat").val();
       // alert('product/index/searchkey-'+searckkey);
        loadPage('product/index/searchkey-'+searckkey+'-'+catid+'-'+subcat);

    {rdelim}
</script>